Beginning SAP Fiori by Bince Mathew
Author:Bince Mathew
Language: eng
Format: epub, pdf
Publisher: Apress, Berkeley, CA
Next you create the controller page for your Users view, to handle events like button clicks, page loads, and so on (see Listing 5-8). The selectedRow function gets the details of any row the user clicks in the table. Similarly, you use JQuery functions to read values directly from fields and toggle the visibility of the form that contains the input fields for creating and editing records based on button clicks.
Listing 5-8. Users.controller.js (Controller Page to Handle the Events of the View)
selectedRow: function(oEvent){
currentRowContext = oEvent.getParameter("rowContext").sPath;
var start = currentRowContext.lastIndexOf('/') + 1;
value = currentRowContext.substring(start, currentRowContext.length);
var oTable = sap.ui.getCore().byId('Table1');
index = oTable.getSelectedIndex();
var data= oTable.getModel().oData[value];
mode = "Update";
$('#Userid').val(data.Userid);
$('#Name').val(data.Name);
$('#Designation').val(data.Designation);
var userId = sap.ui.getCore().byId('Userid');
userId.setEditable(false);
},
Create: function(){
$('#form1').slideDown();
mode = "Create";
$('#Userid').val("");
$('#Name').val("");
$('#Designation').val("");
var userId = sap.ui.getCore().byId('Userid');
userId.setEditable(true);
},
Edit: function(){
$('#form1').slideDown('1000');
mode = "Update";
var oTable = sap.ui.getCore().byId('Table1');
index = oTable.getSelectedIndex();
var data= oTable.getModel().oData[value];
$('#Userid').val(data.Userid);
$('#Userid').editable = false;
$('#Name').val(data.Name);
$('#Designation').val(data.Designation);
},
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Content Management | Programming |
User Experience & Usability | User Generated Content |
Web Design | Web Marketing |
Web Services | Website Analytics |
Hello! Python by Anthony Briggs(9928)
The Mikado Method by Ola Ellnestam Daniel Brolund(9787)
Dependency Injection in .NET by Mark Seemann(9348)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7792)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7568)
Svelte with Test-Driven Development by Daniel Irvine(7273)
Test-Driven Development with PHP 8 by Rainier Sarabia(7010)
Layered Design for Ruby on Rails Applications by Dementyev Vladimir;(6868)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(6541)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6426)
Web Development with Django by Ben Shaw Saurabh Badhwar(6331)
React Application Architecture for Production by Alan Alickovic(6054)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5816)
Kotlin in Action by Dmitry Jemerov(5075)
Audition by Ryu Murakami(4594)
Software Architecture for Web Developers by Mihaela Roxana Ghidersa(4515)
Accelerating Server-Side Development with Fastify by Manuel Spigolon Maksim Sinik & Matteo Collina(4360)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4323)
Solidity Programming Essentials by Ritesh Modi(4066)
